package com.ruoyi.moon.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.moon.mapper.MoonNoticeMapper;
import com.ruoyi.moon.domain.MoonNotice;
import com.ruoyi.moon.service.IMoonNoticeService;

/**
 * 消息Service业务层处理
 * 
 * @author admin
 * @date 2024-11-08
 */
@Service
public class MoonNoticeServiceImpl implements IMoonNoticeService 
{
    @Autowired
    private MoonNoticeMapper moonNoticeMapper;

    /**
     * 查询消息
     * 
     * @param id 消息主键
     * @return 消息
     */
    @Override
    public MoonNotice selectMoonNoticeById(Long id)
    {
        return moonNoticeMapper.selectMoonNoticeById(id);
    }

    /**
     * 查询消息列表
     * 
     * @param moonNotice 消息
     * @return 消息
     */
    @Override
    public List<MoonNotice> selectMoonNoticeList(MoonNotice moonNotice)
    {
        return moonNoticeMapper.selectMoonNoticeList(moonNotice);
    }

    /**
     * 新增消息
     * 
     * @param moonNotice 消息
     * @return 结果
     */
    @Override
    public int insertMoonNotice(MoonNotice moonNotice)
    {
        moonNotice.setCreateTime(DateUtils.getNowDate());
        return moonNoticeMapper.insertMoonNotice(moonNotice);
    }

    /**
     * 修改消息
     * 
     * @param moonNotice 消息
     * @return 结果
     */
    @Override
    public int updateMoonNotice(MoonNotice moonNotice)
    {
        moonNotice.setUpdateTime(DateUtils.getNowDate());
        return moonNoticeMapper.updateMoonNotice(moonNotice);
    }

    /**
     * 批量删除消息
     * 
     * @param ids 需要删除的消息主键
     * @return 结果
     */
    @Override
    public int deleteMoonNoticeByIds(Long[] ids)
    {
        return moonNoticeMapper.deleteMoonNoticeByIds(ids);
    }

    /**
     * 删除消息信息
     * 
     * @param id 消息主键
     * @return 结果
     */
    @Override
    public int deleteMoonNoticeById(Long id)
    {
        return moonNoticeMapper.deleteMoonNoticeById(id);
    }
}
